<style type="text/css">
    .ipu{width:599px;}
    .tsp{color:#888;padding-left:5px;line-height:18px;}
    fieldset{background-color:#efefef;}
    legend{font-size:12px;font-weight:normal;color:#008800;}
</style>
<div class="bjui-pageContent">
    <form id="j_admin_add_form" action="{:url('Advert/edit')}" data-toggle="validate" method="post">
        <input type="hidden" name="aid" value="{$list.aid}" />
        <div class="pageFormContent" data-layout-h="0">
            <fieldset>
                <legend>推广链接基础信息设置</legend>
                <table class="table-condensed table-hover" width="100%">
                    <tbody>
                        <tr>
                            <td>
                                <label for="j_xname" class="control-label x85">推广名称：</label>
                                <input class="ipu" type="text" name="xname" id="j_xname" maxlength="20" value="{$list.xname}" data-rule="required" />
                                <span class="tsp">(如：Q-TF高分鸢T)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="j_tname" class="control-label x85">二级目录：</label>
                                <input class="ipu" type="text" name="tname" id="j_tname" value="{$list.tname}" maxlength="10" data-rule="required;tname;remote[{:url('Advert/same',['tname'=>urlencode($list['tname'])])}]" />
                                <span class="tsp">(唯一标识符,只能字母,数字,"-","_"组合)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="domain" class="control-label x85">使用域名：</label>
                                <select name="did" id="domain" data-toggle="selectpicker" {if count($dArr) > 10}data-live-search="true"{/if} data-width="599">
                                    {volist name="dArr" id="d"}
                                        <option value="{$d.did}" {eq name="$d.did" value="$list.did"}selected{/eq}>{$d.xname}_{$d.domain}</option>
                                    {/volist}
                                </select>
                                <span class="tsp">{:jstips('domain')}(页面链接使用的域名)</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="height:35px;">
                                <label for="" class="control-label x85">访问协议：</label>
                                <input type="radio" name="scheme" id="j_scheme_1" data-toggle="icheck" value="http" {eq name="$list.scheme" value="http"}checked{/eq} data-label="HTTP&nbsp;&nbsp;">
                                <input type="radio" name="scheme" id="j_scheme_2" data-toggle="icheck" value="https" {eq name="$list.scheme" value="https"}checked{/eq} data-label="HTTPS">
                                <span class="tsp">{:jstips('scheme')}(选HTTPS,要确保该域名已经申请开通了https证书)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="j_mid" class="control-label x85">所属员工：</label>
                                <select name="mid" id="j_mid" data-toggle="selectpicker" {if count($mArr) > 10}data-live-search="true"{/if} data-width="599">
                                    {volist name="mArr" id="m"}
                                        <option value="{$m.mid}" {eq name="$m.mid" value="$list.mid"}selected{/eq}>{$m.nickname}</option>
                                    {/volist}
                                </select>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>
            <fieldset>
                <legend>商品信息设置</legend>
                <table class="table-condensed table-hover" width="100%">
                    <tbody>
                        <tr>
                            <td>
                                <label for="category" class="control-label x85">商品分类：</label>
                                <select id="category" onchange="sp_e(this)" data-toggle="selectpicker" {if count($cArr) > 10}data-live-search="true"{/if} data-width="599">
                                    <option value="">--请选择--</option>
                                    {volist name="cArr" id="c"}
                                        <option value="{$c.cid}" {eq name="$c.cid" value="$list.cid"}selected{/eq}>{$c.cname}</option>
                                    {/volist}
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td style="height:35px;">
                                <table>
                                    <tr>
                                        <td><label for="j_pid" class="control-label x85">商品名称：</label></td>
                                        <td>
                                            {volist name="pArr" id="p"}
                                                <div style="display:{if $p.cid == $list.cid}block{else/}none{/if};margin:2px 0px;padding:2px;border:1px #FF6F20 dotted;width:599px;" class="x_e_{$p.cid} sp_e">
                                                <input type="checkbox" id="j_pid_{$p.pid}" name="pids[]" data-toggle="icheck" value="{$p.pid}" {in name="$p.pid" value="$list.pids"}checked{/in} data-label="{$p.pname}">
                                                </div>
                                            {/volist}
                                            <span class="tsp" id="tsp_e" {neq name="$list.cid" value="0"}style="display:none;"{/neq}>(先选择商品分类,用于页面显示的商品)</span>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>
            <fieldset>
                <legend>模板信息设置</legend>
                <table class="table-condensed table-hover" width="100%">
                    <tbody>
                        <tr>
                            <td>
                                <label for="ntpl" class="control-label x85">正常模版：</label>
                                <select name="tnid" id="ntpl" data-toggle="selectpicker" data-live-search="true" data-width="599">
                                    {volist name="tnArr" id="tn"}
                                        <option value="{$tn.tnid}" {eq name="$tn.tnid" value="$list.tnid"}selected{/eq}>{$tn.tname}</option>
                                    {/volist}
                                </select>
                                <span class="tsp">(没被屏蔽时看到的页面模板)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="btpl" class="control-label x85">屏蔽模版：</label>
                                <select name="tbid" id="btpl" data-toggle="selectpicker" data-live-search="true" data-width="599">
                                    {volist name="tbArr" id="tb"}
                                        <option value="{$tb.tbid}" {eq name="$tb.tbid" value="$list.tbid"}selected{/eq}>{$tb.tname}</option>
                                    {/volist}
                                </select>
                                <span class="tsp">(被屏蔽的人所看到的页面模板)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="otpl" class="control-label x85">订单模版：</label>
                                <select name="toid" id="otpl" data-toggle="selectpicker" {if count($toArr) > 10}data-live-search="true"{/if} data-width="599">
                                    {volist name="toArr" id="to"}
                                        <option value="{$to.toid}" {eq name="$to.toid" value="$list.toid"}selected{/eq}>{$to.tname}</option>
                                    {/volist}
                                </select>
                                <span class="tsp">(提交订单后显示订单号的页面模版)</span>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>
            <fieldset>
                <legend>屏蔽信息设置</legend>
                <table class="table-condensed table-hover" width="100%">
                    <tbody>
                        <tr>
                            <td style="height:35px;">
                                <label for="" class="control-label x85">屏蔽模式：</label>
                                <input type="radio" name="mode" id="j_mode1_1" data-toggle="icheck" value="0" {eq name="$list.mode" value="0"}checked{/eq} data-label="普通模式&nbsp;&nbsp;">
                                <input type="radio" name="mode" id="j_mode2_2" data-toggle="icheck" value="1" {eq name="$list.mode" value="1"}checked{/eq} data-label="混合模式">
                            </td>
                        </tr>
                        <tr>
                            <td style="height:35px;">
                                <label for="" class="control-label x85">强制屏蔽：</label>
                                <input type="radio" name="deny" id="j_deny1_1" data-toggle="icheck" value="0" {eq name="$list.deny" value="0"}checked{/eq} data-label="否(只屏蔽下面所选择的地区)&nbsp;&nbsp;">
                                <input type="radio" name="deny" id="j_deny2_2" data-toggle="icheck" value="1" {eq name="$list.deny" value="1"}checked{/eq} data-label="是(强制所有地区都显示屏蔽页面)">
                                (<span style="color:green;">账户审核时或推广停止投放后请选上“是”</span>)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table>
                                    <tr>
                                        <td><label class="control-label x85">屏蔽地区：</label></td>
                                        <td style="padding: 5px 5px;">
                                            <input type="checkbox" id="j_barea" class="checkboxCtrl" data-group="baids[]" data-toggle="icheck" data-label="全部">&nbsp;<br/>
                                            {volist name="baArr" id="ba"}
                                                <div style="float:left;margin:2px 2px 0 0;padding:2px;border:1px #FF6F20 dotted;width:83px;{if ($i % 8) == 0}clear:left;{/if}">
                                                    <input type="checkbox" id="j_barea{$ba.baid}" name="baids[]" data-toggle="icheck" value="{$ba.baid}" {in name="$ba.baid" value="$list.baids"}checked{/in} data-label="{$ba.area}">
                                                </div>
                                            {/volist}
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td style="height:35px;">
                                <label for="" class="control-label x85">基站屏蔽：</label>
                                <input type="radio" name="banbase" id="j_banbase_1" data-toggle="icheck" value="0" {eq name="$list.banbase" value="0"}checked{/eq} data-label="否(不作屏蔽)">&nbsp;&nbsp;
                                <input type="radio" name="banbase" id="j_banbase_2" data-toggle="icheck" value="1" {eq name="$list.banbase" value="1"}checked{/eq} data-label="是(屏蔽基站IP)">
                                <span class="tsp">(基站IP是归属地只有省份没有城市如"广东省 联通"的IP)</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="height:35px;">
                                <label for="" class="control-label x85">终端屏蔽：</label>
                                <input type="radio" name="banpc" id="j_banpc1_1" data-toggle="icheck" value="0" {eq name="$list.banpc" value="0"}checked{/eq} data-label="不作屏蔽">&nbsp;&nbsp;
                                <input type="radio" name="banpc" id="j_banpc2_2" data-toggle="icheck" value="1" {eq name="$list.banpc" value="1"}checked{/eq} data-label="屏蔽电脑端">
                            </td>
                        </tr>
                        <tr>
                            <td style="height:35px;">
                                <label for="" class="control-label x85">禁止访问：</label>
                                <input type="radio" name="unvisit" id="j_unvisit_1" data-toggle="icheck" value="0" {eq name="$list.unvisit" value="0"}checked{/eq} data-label="否(正常访问)&nbsp;&nbsp;">
                                <input type="radio" name="unvisit" id="j_unvisit_2" data-toggle="icheck" value="1" {eq name="$list.unvisit" value="1"}checked{/eq} data-label="是(404错误页面)">
                                <span class="tsp">(用于平台更换域名时设置页面不能打开或其他原因不想让链接能打开)</span>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>
            <fieldset>
                <legend>页面信息设置</legend>
                <table class="table-condensed table-hover" width="100%">
                    <tbody>
                        <tr>
                            <td>
                                <table>
                                    <td><label for="j_link" class="control-label x85">链接地址：</label></td>
                                    <td>
                                        <input type="text" name="link" id="j_link" value="{$list.link}" class="ipu" />
                                        <span class="tsp">{:jstips('link')}(可不填,可用于页面内部跳转,页面之间跳转等)</span>
                                    </td>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="j_company" class="control-label x85">公司名称：</label>
                                <input type="text" name="company" id="j_company" value="{$list.company}" data-rule="" class="ipu" />
                                <span class="tsp">{:jstips('company')}(页面显示的公司名称,可不填)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="j_address" class="control-label x85">公司地址：</label>
                                <input type="text" name="address" id="j_address" value="{$list.address}" data-rule="" class="ipu" />
                                <span class="tsp">{:jstips('address')}(页面显示的公司地址,可不填)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="j_beian" class="control-label x85">备案信息：</label>
                                <textarea name="beian" id="j_beian" cols="60" rows="2">{$list.beian}</textarea>
                                <span class="tsp">{:jstips('beian|raw')}(页面显示的备案信息,可不填)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table>
                                    <tr>
                                        <td><label for="j_color" class="control-label x85">备案颜色：</label></td>
                                        <td>
                                            <input type="text" name="color" id="j_color" value="{$list.color}" {notempty name="list.color"}style="background:{$list.color}"{/notempty} data-toggle="colorpicker" data-bgcolor="true" readonly class="ipu" />
                                            <a href="javascript:;" title="清除颜色" data-toggle="clearcolor" data-target="#j_color">清除颜色</a>
                                            <span class="tsp">(可不填,备案信息的显示颜色)</span>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="j_telno" class="control-label x85">电话号码：</label>
                                <input type="text" name="telno" id="j_telno" value="{$list.telno}" data-rule="" class="ipu" />
                                <span class="tsp">{:jstips('telno')}(页面显示的020咨询固话,可不填)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="j_mobile" class="control-label x85">手机号码：</label>
                                <input type="text" name="mobile" id="j_mobile" value="{$list.mobile}" maxlength="11" data-rule="" class="ipu" />
                                <span class="tsp">{:jstips('mobile')}(页面使用的手机号码,可不填)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="" class="control-label x85">访问统计：</label>
                                <input type="radio" name="ismo" id="j_ismo_1" data-toggle="icheck" value="0" {eq name="$list.ismo" value="0"}checked{/eq} data-label="关闭&nbsp;&nbsp;">
                                <input type="radio" name="ismo" id="j_ismo_2" data-toggle="icheck" value="1" {eq name="$list.ismo" value="1"}checked{/eq} data-label="开启">
                                <span class="tsp">(用于统计页面访问到中部，底部数据)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="j_jscode" class="control-label x85">统计代码：</label>
                                <textarea name="jscode" id="j_jscode" cols="60" rows="4">{$list.jscode}</textarea>
                                <span class="tsp">{:jstips('jscode|raw')}(页面cnzz,51la..统计代码)</span>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>
            <fieldset>
                <legend>订单信息设置</legend>
                <table class="table-condensed table-hover" width="100%">
                    <tbody>
                        <tr>
                            <td>
                                <table>
                                    <tr>
                                        <td><label for="j_url" class="control-label x85">订单跳转：</label></td>
                                        <td>
                                            <input type="text" name="url" id="j_url" value="{$list.url}" class="ipu" />
                                            <span class="tsp">(提交订单成功后，返回首页按钮指向的地址，不填默认原页面)</span>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="j_tips" class="control-label x85">提示信息：</label>
                                <textarea name="tips" id="j_tips" cols="60" rows="2">{$list.tips}</textarea>
                                <span class="tsp">(下单成功后，网页的提示信息，可不填，默认使用全局设置)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="" class="control-label x85">禁止下单：</label>
                                <input type="radio" name="isuno" id="j_isuno_1" data-toggle="icheck" value="0" {eq name="$list.isuno" value="0"}checked{/eq} data-label="否&nbsp;&nbsp;">
                                <input type="radio" name="isuno" id="j_isuno_2" data-toggle="icheck" value="1" {eq name="$list.isuno" value="1"}checked{/eq} data-label="是">
                                <span class="tsp">(禁止后该页面不再接收表单)</span>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>
            <fieldset>
                <legend>其他信息设置</legend>
                <table class="table-condensed table-hover" width="100%">
                    <tbody>
                        <tr>
                            <td style="height:35px;">
                                <label for="" class="control-label x85">使用状况：</label>
                                <input type="radio" name="used" id="j_lock1_1" data-toggle="icheck" value="0" {eq name="$list.used" value="0"}checked{/eq} data-label="未用&nbsp;&nbsp;">
                                <input type="radio" name="used" id="j_lock2_2" data-toggle="icheck" value="1" {eq name="$list.used" value="1"}checked{/eq} data-label="在用">
                            </td>
                        </tr>
                        <tr>
                            <td style="height:35px;">
                                <label for="" class="control-label x85">调试模式：</label>
                                <input type="radio" name="debug" id="j_debug_1" data-toggle="icheck" value="0" {eq name="$list.debug" value="0"}checked{/eq} data-label="关闭">&nbsp;&nbsp;
                                <input type="radio" name="debug" id="j_debug_2" data-toggle="icheck" value="1" {eq name="$list.debug" value="1"}checked{/eq} data-label="开启">
                                <span class="tsp">(开启后该页面最顶端显示IP信息)</span>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>
        </div>
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="undo">取消</button></li>
        <li><button type="submit" class="btn-green" data-icon="save">保存</button></li>
    </ul>
</div>
<script type="text/javascript">
    function sp_e(obj){
        var cid = $(obj).val();
        if($.trim(cid) != ''){
            $('.sp_e').hide();
            $('.sp_e').find('input').attr('disabled', true);
            $('.x_e_'+cid).show();
            $('.x_e_'+cid).find('input').removeAttr('disabled');
            $('#tsp_e').hide();
        }else{
            $('.sp_e').hide();
            $('.sp_e').find('input').attr('disabled', true);
            $('#tsp_e').show();
        }
    }
</script>